package com.boyon.web.servlet.tomcat;

import org.apache.catalina.Context;
import org.apache.catalina.Manager;
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory;

/**
 * ClassName:TomcatContainerFactory <br/>
 * Function: 扩展TomcatEmbeddedServletContainerFactory. <br/>
 * Date: 2018年3月26日 下午8:47:47 <br/>
 * 
 * @author sunshulin
 * @version
 * @since JDK 1.8
 * @see
 */
public class TomcatContainerFactory
		extends TomcatEmbeddedServletContainerFactory {

	private Manager manager;

	/**
	 * Creates a new instance of TomcatContainerFactory.
	 * 
	 * @param manager
	 */
	public TomcatContainerFactory(Manager manager) {
		super();
		this.manager = manager;
	}

	/**
	 * contenx扩展类实现,设置manager.
	 * 
	 * @see org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory#postProcessContext(org.apache.catalina.Context)
	 */
	protected void postProcessContext(Context context) {
		super.postProcessContext(context);
		context.setManager(manager);
	}

}
